import os

with open('test.csv', 'a') as f:
    for file in os.listdir('/root/code/tianchi/data/test/video'):
        if file.endswith('.ts'):
            f.write(f'{file},0\n')